﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<%@ include file="_meta.jsp" %>
<body>
<%@ include file="_header.jsp" %>
<%@ include file="_menu.jsp" %>
<section class="Hui-article-box">
    <nav class="breadcrumb"><i class="Hui-iconfont"></i> <a href="/" class="maincolor">首页</a>
        <span class="c-999 en">&gt;</span>
        <span class="c-666">我的桌面</span>
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="Hui-article">
        <article class="cl pd-20">

            <table class="table table-border table-bordered table-bg course_table">
                <thead>
                <tr>
                    <th colspan="7" scope="col">信息统计</th>
                </tr>
                <tr>
                    <th>课程名称</th>
                    <th>任教老师</th>
                    <th>学分</th>
                    <th>总课时</th>
                    <th>专业</th>
                    <th>最大选课人数</th>
                    <th>选择</th>
                </tr>
                </thead>
                <tbody>


                <c:forEach var="course" items="${sessionScope.cp.datas}" varStatus="outStatus">
                    <tr row="${outStatus.index}" class="symbol">
                        <td>
                            <input type="text" class="table_in_input" readonly value="${course.CNAME}"/>
                        </td>
                        <td>
                            <select class="tcb">
                                <c:forEach var="teacher" items="${teachers}" varStatus="trow">
                                    <c:choose>
                                        <c:when test="${teacher.tid==course.TID}">
                                            <option selected value="${teacher.tname}"
                                                    tid="${teacher.tid}">${teacher.tname}</option>
                                        </c:when>
                                        <c:otherwise>
                                            <option value="${teacher.tname}"
                                                    tid="${teacher.tid}">${teacher.tname}</option>
                                        </c:otherwise>
                                    </c:choose>
                                </c:forEach>
                            </select>

                        </td>

                        <td>
                            <input type="text" class="table_in_input" readonly='true' value="${course.CREDIT}"/>
                        </td>

                        <td>
                            <input type="text" class="table_in_input" readonly='true' value="${course.CHOUR}"/>

                        </td>
                        <td>
                            <select class="mcb">
                                <c:forEach var="major" items="${majors}" varStatus="trow">
                                    <c:choose>
                                        <c:when test="${course.MAJOR_ID==major.major_id}">
                                            <option selected value="${major.major_name}"
                                                    major_id="${major.major_id}">${major.major_name}</option>
                                        </c:when>
                                        <c:otherwise>
                                            <option value="${major.major_name}"
                                                    major_id="${major.major_id}">${major.major_name}</option>
                                        </c:otherwise>
                                    </c:choose>
                                </c:forEach>
                            </select>
                        </td>
                        <td>
                            <input type="text" class="table_in_input" readonly='true' value="${course.MAX_PEOPLE}"/>

                        </td>
                        <td><input type="checkbox" cid="${course.CID}"/></td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
            <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
                <c:choose>
                    <c:when test="${sessionScope.cp.currentPage==1}">
                        <a class="paginate_button previous disabled" aria-controls="DataTables_Table_0" data-dt-idx="0"
                           tabindex="0" id="DataTables_Table_0_previous"
                        >上一页
                        </a>
                    </c:when>
                    <c:otherwise>
                        <a class="paginate_button previous disabled" aria-controls="DataTables_Table_0" data-dt-idx="0"
                           tabindex="0" id="DataTables_Table_0_previous"
                           href="${pageContext.request.contextPath}/admin/query_course_by_page?currentPage=${sessionScope.cp.currentPage-1}"
                        >上一页
                        </a>
                    </c:otherwise>
                </c:choose>

                <span>
                    <a class="paginate_button current"
                       aria-controls="DataTables_Table_0"
                       data-dt-idx="1" tabindex="0"
                       href="${pageContext.request.contextPath}/admin/query_course_by_page?currentPage=${sessionScope.cp.currentPage}"
                    >${sessionScope.cp.currentPage}
                    </a>
                    <a class="paginate_button " aria-controls="DataTables_Table_0" data-dt-idx="2"
                       tabindex="0"
                       href="${pageContext.request.contextPath}/admin/query_course_by_page?currentPage=${sessionScope.cp.currentPage+1}"
                    >${sessionScope.cp.currentPage+1}
                    </a>
                </span>
                <c:choose>
                    <c:when test="${sessionScope.cp.currentPage==sessionScope.cp.totalPage}">
                        <a class="paginate_button next" aria-controls="DataTables_Table_0"
                           data-dt-idx="3" tabindex="0" id="DataTables_Table_0_next"
                        >下一页
                        </a>
                    </c:when>
                    <c:otherwise>
                        <a class="paginate_button next" aria-controls="DataTables_Table_0"
                           data-dt-idx="3" tabindex="0" id="DataTables_Table_0_next"
                           href="${pageContext.request.contextPath}/admin/query_course_by_page?currentPage=${sessionScope.cp.currentPage+1}"
                        >下一页
                        </a>
                    </c:otherwise>
                </c:choose>

            </div>
        </article>

        <footer class="footer">
            <p>
                感谢jQuery、layer、laypage、Validform、UEditor、My97DatePicker、iconfont、Datatables、WebUploaded、icheck、highcharts、bootstrap-Switch<br>
                Copyright &copy;2015 H-ui.admin v3.0 All Rights Reserved.<br> 本后台系统由<a href="http://www.h-ui.net/"
                                                                                       target="_blank" title="H-ui前端框架">H-ui前端框架</a>提供前端技术支持
            </p>
        </footer>
    </div>
</section>

<%@ include file="_footer.jsp" %>
<script src="${pageContext.request.contextPath}/js/show_course_comm.js"></script>
<script>


</script>
</body>
</html>